﻿using System;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal class DXFRecord : WorksheetLevelRecord
    {
        private FrtHeader frtHeader ;
        private XFProps XFProps;
        private bool fNewBorder;

        protected override void ReadContent(BiffReaderContext context, int length)
        {
            frtHeader.Read(context.Reader);
            var abc = context.ReadUInt16();
            this.fNewBorder = (abc & 0x2) != 0;
            this.XFProps.Read(context.Reader);
        }

        internal override BiffRecordType RecordType
        {
            get { return BiffRecordType.DXF; }
        }

        internal override void Apply(BiffReaderWorksheetContext context)
        {
            throw new NotImplementedException();
        }

        internal override void WriteContent(BiffWriterWorkbookContext context)
        {
            frtHeader.Write(context);
            ushort abc = fNewBorder ? (ushort)0x2 : (ushort)0;
            context.WriteUInt16(abc);
            XFProps.Write(context.Writer);
        }
    }
}